export const createStore = (reducer) => {
  let listeners = [],
    currentState = {}
  function getState(){
    return currentState
  }
  function subscribe(listener){
    listeners.push(listener)
  }
  function dispatch(action){
    currentState = reducer(currentState, action)
    listeners.forEach(v => v.call(this))
  }
  dispatch({
    type:`@@VARQIN&CONSTQIAODX`
  })
  return {
    getState,
    subscribe,
    dispatch
  }
}